﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace HYRevitCode.ShortPathSuite
{
	public abstract class BaseResultBaen
	{
		public List<XYZ> LstPoints
		{
			get
			{
				return this.m_lstPoints;
			}
		}

		public double Distance
		{
			get
			{
				return this.m_dDistance;
			}
			protected set
			{
				this.m_dDistance = value;
			}
		}

		public List<Line> GetLines()
		{
			List<Line> list = new List<Line>();
			for (int i = 0; i < this.LstPoints.Count - 1; i++)
			{
				if (!this.LstPoints[i].IsAlmostEqualTo(this.LstPoints[i + 1]))
				{
					list.Add(Line.CreateBound(this.LstPoints[i], this.LstPoints[i + 1]));
				}
			}
			return list;
		}

		public static double CalculateDistance(List<XYZ> input)
		{
			double num = -1.0;
			if (input != null && input.Count != 0 && 1 != input.Count)
			{
				num = 0.0;
				for (int i = 0; i < input.Count - 1; i++)
				{
					num += input[i].DistanceTo(input[i + 1]);
				}
			}
			return num;
		}

		protected List<XYZ> m_lstPoints;

		protected double m_dDistance;
	}
}
